﻿using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;

namespace cmdb.keede.entity.Migrations
{
    public partial class updatetable : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "UserName",
                table: "VirtualHostInfo",
                newName: "AdminName");

            migrationBuilder.AlterColumn<int>(
                name: "OS",
                table: "VirtualHostInfo",
                unicode: false,
                maxLength: 32,
                nullable: false,
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 32);

            migrationBuilder.AlterColumn<int>(
                name: "DeviceType",
                table: "VirtualHostInfo",
                unicode: false,
                maxLength: 10,
                nullable: false,
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 10);

            migrationBuilder.AddColumn<string>(
                name: "OSVersion",
                table: "VirtualHostInfo",
                nullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "Status",
                table: "ApplicationHost",
                unicode: false,
                maxLength: 10,
                nullable: false,
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 10);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "OSVersion",
                table: "VirtualHostInfo");

            migrationBuilder.RenameColumn(
                name: "AdminName",
                table: "VirtualHostInfo",
                newName: "UserName");

            migrationBuilder.AlterColumn<string>(
                name: "OS",
                table: "VirtualHostInfo",
                unicode: false,
                maxLength: 32,
                nullable: false,
                oldClrType: typeof(int),
                oldUnicode: false,
                oldMaxLength: 32);

            migrationBuilder.AlterColumn<string>(
                name: "DeviceType",
                table: "VirtualHostInfo",
                unicode: false,
                maxLength: 10,
                nullable: false,
                oldClrType: typeof(int),
                oldUnicode: false,
                oldMaxLength: 10);

            migrationBuilder.AlterColumn<string>(
                name: "Status",
                table: "ApplicationHost",
                unicode: false,
                maxLength: 10,
                nullable: false,
                oldClrType: typeof(int),
                oldUnicode: false,
                oldMaxLength: 10);
        }
    }
}
